

<%@ page import="com.surelution.projects.crm.Promoting" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'promoting.label', default: 'Promoting')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
        </div>
        <div class="body">
            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${promotingInstance}">
            <div class="errors">
                <g:renderErrors bean="${promotingInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${promotingInstance?.id}" />
                <g:hiddenField name="version" value="${promotingInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>

                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="stationGas"><g:message code="promoting.stationGas.label" default="Station Gas" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: promotingInstance, field: 'stationGas', 'errors')}">
							    	${promotingInstance.stationGas.station.name},${promotingInstance.stationGas.gasType.name}
                                </td>
                            </tr>
                                                    
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="description"><g:message code="promoting.description.label" default="Description" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: promotingInstance, field: 'description', 'errors')}">
                                    <g:textField name="description" value="${promotingInstance?.description}" />
                                </td>
                            </tr>
                                                
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="price"><g:message code="promoting.price.label" default="Price" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: promotingInstance, field: 'price', 'errors')}">
                                    <g:textField name="price" value="${fieldValue(bean: promotingInstance, field: 'price')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="promotingType"><g:message code="promoting.promotingType.label" default="Promoting Type" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: promotingInstance, field: 'promotingType', 'errors')}">
                                    <g:select name="promotingType.id" from="${com.surelution.projects.crm.PromotingType.list()}" optionKey="id" optionValue="title" value="${promotingInstance?.promotingType?.id}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="startDate"><g:message code="promoting.startDate.label" default="Start Date" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: promotingInstance, field: 'startDate', 'errors')}">
                                    <g:datePicker name="startDate" precision="day" value="${promotingInstance?.startDate}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="endDate"><g:message code="promoting.endDate.label" default="End Date" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: promotingInstance, field: 'endDate', 'errors')}">
                                    <g:datePicker name="endDate" precision="day" value="${promotingInstance?.endDate}" default="none" noSelection="['': '']" />
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
